home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 …ember: Reference Library / Dev.CD Dec 97 RL.toast / What's New / Tool Chest / Testing & Debugging / Virtual User / Examples / External Tool Templates / CPlus Tool Template / ThreadedVUTool.vulib < prev    next >
Encoding:
Text File  |  1997-10-15  |  1.7 KB  |  48 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        ThreadedVUTool.vulib
  3. #
  4. #    Contains:    The tool definition along with the high level tasks to access
  5. #                the tool's services
  6. #
  7. #    
  8. #    Written by:    Stuart Russell from FileTool by P. Nagarajan
  9. #
  10. #    Copyright:    © 1993-4 by Apple Computer, Inc., all rights reserved.
  11. #
  12. #    Change History (most recent first):
  13. #
  14. #                 10/30/94    SBR        Built with Echo service
  15. #                 03/26/93    NAGA    xxx put comment here xxx
  16. #
  17. #    To Do:
  18. #
  19.  
  20. tool ThreadedVUTool s:'vu21'
  21. begin
  22.     # Services specific to ThreadedVUTool:
  23.     
  24.     # To Echo a list after a number of ticks, in a new thread 
  25.     Service    "EchoThread"( 'undefined', 'integer', 'symbol', 'integer' ) return 'undefined';
  26.     # first parameter is the value or list of values to echo 
  27.     # second parameter is the number of ticks to pause before returning
  28.     # third parameter is Boolean: 
  29.     #        true means beep entering and leaving ProcessRequest()
  30.     #        false means do not 
  31.     # fourth parameter is integer n: 
  32.     #        non-zero means beep after every n loops waiting for the cancel
  33.     #        zero means do not beep while looping
  34.     # return value should be equal to first parameter except when:
  35.     #        symbol and descriptor parameters are turned into strings by VU
  36.     #        integers are sent to the tool as long or short based on VU version
  37.     #        longs are sent to the script as long or string based on VU version
  38.     
  39.     # To Echo a list after a number of ticks, in the RequestDispatcher thread 
  40.     Service    "EchoNoThread"( 'undefined', 'integer', 'symbol', 'integer' ) return 'undefined';
  41.     # same as Echo service except this one is non-threaded
  42.     
  43.     # To set the number of ticks given to WaitNextEvent() in the tool
  44.     # Only affects the tool when it is in the background
  45.     # returns the previous value
  46.     Service    "SetSleepTicks"( 'integer' ) return 'integer';
  47.         
  48. end;